package com.wyh.domain.vo.gfive.treeVo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Api("用于生成树的组织VO")
@TableName("organization")
public class OrganizationVO {

    @ApiModelProperty("主键")
    @TableId(type = IdType.AUTO)
    private Integer id;

    @NotNull(message = "上级组织id不能为空")
    @ApiModelProperty("上级组织id")
    @TableField("superiorid")
    private Integer superiorId;

    @Size(max = 50, min = 10, message = "组织名称必须为10-50个字符")
    @ApiModelProperty("组织名称")
    @Length(max = 50, min = 10, message = "组织名称必须为10-50个字符")
    @NotNull(message = "组织名称不能为空")
    @TableField("name")
    private String name;


    @ApiModelProperty("是否启用，1启用，0停用")
    @NotNull(message = "状态不能为空")
    @TableField("state")
    private Integer state;
}
